package com.liam.forum.exception;

import com.liam.forum.common.AppResult;

/**
 * @Author: LiamLMK
 * @CreateTime: 2024-09-19
 * @Description: 为可预见的错误返回自定义异常
 * @Version: 1.0
 */

public class ApplicationException extends RuntimeException{

    protected AppResult errorResult;

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException() {
        super();
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public AppResult getErrorResult() {
        return errorResult;
    }
}
